<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>后台桌面</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="stylesheet" href="__HOME_CSS__/font.css">
    <link rel="stylesheet" href="__HOME_CSS__/xadmin.css">
    <script src="__HOME_JS__/echarts.min.js"></script>
    <script src="__HOME_LIB__/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__HOME_JS__/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="__HOME_JS__/html5.min.js"></script>
    <script src="__HOME_JS__/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <blockquote class="layui-elem-quote">欢迎管理员：
                        <span class="x-red">{$session.username}</span>
                    </blockquote>
                    <!--<div class="layui-input-inline">
                      <button class="layui-btn" onclick="" >一键开柜</button>
                    </div>-->
                </div>
            </div>
        </div>
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">快速导航
                    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
                       onclick="location.reload()" title="刷新">
                        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
                    </a>
                </div>
                <div class="layui-card-body ">
                    <ul class="layui-row layui-col-space10 layui-this x-admin-carousel x-admin-backlog">
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:void(0)"
                               onclick="parent.xadmin.add_tab('设备列表','{:url('index/index/member_list')}')"
                               class="x-admin-backlog-body">
                                <h3>员工数量</h3>
                                <p><cite>{$table_data.user_num}</cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:void(0)"
                               onclick="parent.xadmin.add_tab('设备列表','{:url('index/device/device_list')}')"
                               class="x-admin-backlog-body">
                                <h3>设备总数量</h3>
                                <p><cite>{$table_data.device_num}</cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:void(0)"
                               onclick="parent.xadmin.add_tab('安检设备列表','{:url('index/securitycheck/warningdevice')}')"
                               class="x-admin-backlog-body">
                                <h3>待安检设备</h3>
                                <p><cite>{$table_data.overhaul_num}</cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:void(0)"
                               onclick="parent.xadmin.add_tab('异常记录','{:url('index/information/unusual_record')}')"
                               class="x-admin-backlog-body">
                                <h3>异常信息</h3>
                                <p><cite>{$table_data.unusual_num}</cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6">
                            <a href="javascript:void(0)"
                               onclick="parent.xadmin.add_tab('设备使用记录','{:url('index/information/used_record')}')"
                               class="x-admin-backlog-body">
                                <h3>设备使用记录</h3>
                                <p><cite>{$table_data.use_record_num}</cite></p>
                            </a>
                        </li>
                        <li class="layui-col-md2 layui-col-xs6 ">
                            <a href="javascript:void(0)"
                               onclick="parent.xadmin.add_tab('设备列表','{:url('index/information/gear_record')}')"
                               class="x-admin-backlog-body">
                                <h3>人员取用/归还记录</h3>
                                <p><cite>{$table_data.gear_record_num}</cite></p>
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        <div class="">
            <div class="layui-row layui-col-space15">

                <div class="layui-col-sm12 layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">取用归还操作情况</div>
                        <div class="layui-card-body" style="min-height: 320px;">
                            <div id="echart1" class="layui-col-sm12" style="height: 300px; width: 800px"></div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-sm12 layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">设备取用/归还情况</div>
                        <div class="layui-card-body" style="min-height: 320px;">
                            <div id="echart2" class="layui-col-sm12" style="height: 300px; width: 800px"></div>
                        </div>
                    </div>
                </div>


            </div>
        </div>

        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-header">系统信息</div>
                    <div class="layui-card-body ">
                        <table class="layui-table">
                            <tbody>
                            <tr>
                                <th>后台版本</th>
                                <td>1.0.1</td>
                            </tr>
                            <tr>
                                <th>服务器地址</th>
                                <td>{:$_SERVER['SERVER_NAME']}</td>
                            </tr>
                            <tr>
                                <th>操作系统</th>
                                <td>{:php_uname()}</td>
                            </tr>
                            <tr>
                                <th>运行环境</th>
                                <td>Apache/2.4.39</td>
                            </tr>
                            <tr>
                                <th>PHP版本</th>
                                <td>{:PHP_VERSION}</td>
                            </tr>
                            <tr>
                                <th>PHP运行方式</th>
                                <td>cgi-fcgi</td>
                            </tr>
                            <tr>
                                <th>MYSQL版本</th>
                                <td>8.0.12</td>
                            </tr>
                            <tr>
                                <th>ThinkPHP</th>
                                <td>5.1</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--    取用归还操作情况-->
    <script type="text/javascript">

        // 基于准备好的dom，初始化echarts实例
        var myChart1 = echarts.init(document.getElementById('echart1'));

        // 指定图表的配置项和数据
        var colors = ['#5793f3', '#d14a61', '#675bba'];

        option1 = {
            color: colors,

            tooltip: {
                trigger: 'none',
                axisPointer: {
                    type: 'cross'
                }
            },
            legend: {
                data: ['取用', '归还']
            },
            grid: {
                top: 70,
                bottom: 50
            },
            xAxis: [
                {
                    type: 'category',
                    axisTick: {
                        alignWithLabel: true
                    },
                    axisLine: {
                        onZero: false,
                        lineStyle: {
                            color: colors[1]
                        }
                    },
                    axisPointer: {
                        label: {
                            formatter: function (params) {
                                return '操作数量  ' + params.value
                                    + (params.seriesData.length ? '：' + params.seriesData[0].data : '');
                            }
                        }
                    },

                    data: [{$record_group}]
                },
                {
                    type: 'category',
                    axisTick: {
                        alignWithLabel: true
                    },
                    axisLine: {
                        onZero: false,
                        lineStyle: {
                            color: colors[0]
                        }
                    },
                    axisPointer: {
                        label: {
                            formatter: function (params) {
                                return '操作人数  ' + params.value
                                    + (params.seriesData.length ? '：' + params.seriesData[0].data : '');
                            }
                        }
                    },
                    data: [{$record_group}]
                }
            ],
            yAxis: [
                {
                    type: 'value'
                }
            ],
            series: [
                {
                    name: '归还',
                    type: 'line',
                    xAxisIndex: 1,
                    smooth: true,
                    data: {$back_record}
                },
                {
                    name: '取用',
                    type: 'line',
                    smooth: true,
                    data: {$get_record}
                }
            ]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart1.setOption(option1);
    </script>

    <!-- 设备使用情况 -->
    <script type="text/javascript">
        // 基于准备好的dom，初始化echarts实例
        var myChart2 = echarts.init(document.getElementById('echart2'));

        option2 = {
            title: {
                text: '设备使用情况',
                left: 'left'
            },
            tooltip: {
                trigger: 'item',
                formatter: '{b} : {c} ({d}%)'
            },
            legend: {
                bottom: 10,
                left: 'center',
                data: ['使用中', '空闲中', '充电中', '安检中', '待安检']
            },
            series: [
                {
                    type: 'pie',
                    radius: '65%',
                    center: ['50%', '50%'],
                    selectedMode: 'single',
                    data: [
                        {
                            value: {$device_chart.in_use},
                            name: '使用中',
                        },
                        {
                            value: {$device_chart.in_charge},
                            name: '充电中',
                        },
                        {
                            value: {$device_chart.in_check},
                            name: '安检中'
                        },
                        {
                            value: {$device_chart.wait_check},
                            name: '待安检'
                        },
                        {
                            value: {$device_chart.free},
                            name: '空闲'
                        }
                    ],
                    emphasis: {
                        itemStyle: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        };
        myChart2.setOption(option2);

    </script>

</div>

<style id="welcome_style"></style>
<div class="layui-row layui-col-space15">
    <blockquote class="layui-elem-quote layui-quote-nm">Copyright@2020</blockquote>
</div>
</body>
</html>